#include <raw_api.h>
#include "stm32f4xx_rcc.h"
#include <led.h>
#include "raw_printf.h"

extern void board_init(void);

#define  TEST_TASK_STK_SIZE 512

PORT_STACK test_task_stack1[TEST_TASK_STK_SIZE];


RAW_TASK_OBJ test_task_obj;



/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t* file, uint32_t line)
{ 
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {
  }
}


RAW_U32 task_count_numbers;
volatile float test_f = 0.001;
void test_task1(void * pParam) 
{	
	board_init();
	
	while(1) {
		
		led_on();
		task_count_numbers++;
		test_f += 0.01f;
		raw_sleep(30);
		led_off();
		raw_sleep(30);
		printf("task_count_numbers is: %d \r\n" , task_count_numbers);
		printf("test_f %f \r\n" , test_f);
		
	}
	
}


int main ()
{
	raw_os_init();
	
	raw_task_create(&test_task_obj, (RAW_U8  *)"task1", 0,
	                         3, 0,  test_task_stack1, 
	                         TEST_TASK_STK_SIZE ,  test_task1, 1); 
	raw_os_start();
}

